<!--  -->
<template>
  <div>
    <el-dialog title="志愿评估" @close="close" :visible="isVisible">
      <el-row>
        <el-col :span="10">本科已报：{{ eva.collegeNum }}所,剩余可报：{{ remain(eva.collegeNum) }}所</el-col>
        <el-col :span="8">
          <span v-if="!(96 - eva.collegeNum) <= 0" style="color:red">建议报满！！</span>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="10">专科已报：{{ eva.specialNum }}所,剩余可报：{{ remain(eva.specialNum) }}所</el-col>
        <el-col :span="8">
          <span v-if="!(96 - eva.collegeNum) <= 0" style="color:red">建议报满！！</span>
        </el-col>
      </el-row>
      <el-divider></el-divider>
      <el-row>
        <el-col>冲：{{ eva.sprint }}所</el-col>
      </el-row>
      <el-row>
        <el-col>保：{{ eva.stable }}所</el-col>
      </el-row>
      <el-row>
        <el-col>稳：{{ eva.guaranteed }}所</el-col>
      </el-row>
      <el-row>
        <el-col>垫：{{ eva.must }}所</el-col>
      </el-row>
      <el-row>
        <el-col> <span style="color:red">继续加油哦！</span> </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="close">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { eva } from '@/api/aspiration/aspiration'
export default {
  props: ['isVisible'],
  data() {
    return { eva: {} }
  },
  mounted() {
    const userId = JSON.parse(localStorage.getItem('user')).id
    eva({ userId }).then(res => {
      console.log(res)
      this.eva = res.data
    })
  },
  methods: {
    remain(num) {
      return 96 - num < 0 ? 0 : 96 - num
    },
    close() {
      this.$emit('update:isShow', false)
    }
  }
}
</script>

<style scoped></style>
